﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Presidenta.Master" AutoEventWireup="true" CodeBehind="CrearTarea.aspx.cs" Inherits="Interfaces.Tareas.CrearTarea" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style9
        {
            height: 26px;
        }
        .style20
        {
            width: 125px;
        }
        .style21
        {
            width: 125px;
            height: 26px;
        }
        .style24
        {
            width: 222px;
        }
        .style29
        {
            width: 442px;
        }
        .style31
        {
            width: 173px;
        }
        .style39
        {
            width: 720px;
        }
        .style40
        {
            width: 720px;
            height: 26px;
        }
        .style43
        {
            width: 523px;
        }
        .style44
        {
            width: 523px;
            height: 26px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
<script>
    function Count(text) {
        //asp.net textarea maxlength doesnt work; do it by hand
        var maxlength = 150; //set your value here (or add a parm and pass it in)
        var object = document.getElementById(text.id)  //get your object
        if (object.value.length > maxlength) {
            object.focus(); //set focus to prevent jumping
            object.value = text.value.substring(0, maxlength); //truncate the value
            object.scrollTop = object.scrollHeight; //scroll to the end to prevent jumping
            return false;
        }
        return true;
    }
</script>
</h2>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
            </asp:ScriptManagerProxy>
            <asp:MultiView ID="MultiView1" runat="server">
                <asp:View ID="View1" runat="server">
                 <asp:Panel ID="Panel1" runat="server" GroupingText="Crear Tarea" 
                        style="text-align: left">

                <table class="style1">
                    <tr>
                        <td class="style43">
                            &nbsp;</td>
                        <td class="style39">
                            &nbsp;</td>
                        <td class="style20">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style44">
                            &nbsp;&nbsp;&nbsp;&nbsp; Nombre de la tarea&nbsp;</td>
                        <td class="style40">
                            <asp:TextBox ID="TextBox1" runat="server" MaxLength="20"></asp:TextBox>
                          
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="TextBox1" 
                                ErrorMessage="*No se permiten caracteres especiales" ForeColor="Red" 
                                ValidationExpression="^[0-9a-zA-Z\s]+$"></asp:RegularExpressionValidator>
                          
                        </td>
                        <td class="style21">
                            &nbsp;</td>
                        <td class="style9">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style44">
                            &nbsp;&nbsp;&nbsp;&nbsp; Asignar tarea a Miembro&nbsp;</td>
                        <td class="style40">
                            <asp:TextBox ID="TextBox5" runat="server" ReadOnly="True"></asp:TextBox>
                            <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                                style="height: 26px" Text="Buscar Miembro" CssClass=JCIstyle />
                            <asp:Label ID="Label1" runat="server" Visible="False"></asp:Label>
                            <asp:Label ID="Label2" runat="server" Visible="False"></asp:Label>
                        </td>
                        <td class="style21">
                            &nbsp;</td>
                        <td class="style9">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style44">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relacionar Tarea con un Programa&nbsp;&nbsp;</td>
                        <td class="style40">
                            <asp:TextBox ID="TextBox6" runat="server" ReadOnly="True"></asp:TextBox>
                            <asp:Button ID="Button4" runat="server" onclick="Button4_Click" 
                                Text="Buscar Programa" CssClass=JCIstyle />
                            <asp:Button ID="Button5" runat="server" onclick="Button5_Click" Text="Borrar" 
                                Width="61px" CssClass=JCIstyle />
                        </td>
                        <td class="style21">
                            &nbsp;</td>
                        <td class="style9">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style43">
                            &nbsp; &nbsp;&nbsp;&nbsp; Descripcion&nbsp;de la tarea</td>
                        <td class="style39">
                            <asp:TextBox ID="TextBox2" runat="server" Height="76px" TextMode="MultiLine" 
                                Width="348px"  onKeyUp="javascript:Count(this);" onChange="javascript:Count(this);"></asp:TextBox>
                        </td>
                        <td class="style20">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style43">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fecha&nbsp;</td>
                        <td class="style39">
                            <asp:TextBox ID="TextBox3" runat="server" Enabled="False" Width="98px"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="TextBox3_CalendarExtender" runat="server" 
                                Enabled="True" Format="yyyy-MM-dd" PopupButtonID="ImageButton1" TargetControlID="TextBox3">
                            </ajaxToolkit:CalendarExtender>
                            <asp:ImageButton ID="ImageButton1" runat="server" 
                                ImageUrl="~/Images/calendar.jpg" />
                            &nbsp;&nbsp;&nbsp; a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:TextBox ID="TextBox4" runat="server" Enabled="False" Width="98px"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="TextBox4_CalendarExtender" runat="server" 
                                Enabled="True" Format="yyyy-MM-dd" PopupButtonID="ImageButton2" TargetControlID="TextBox4">
                            </ajaxToolkit:CalendarExtender>
                            <asp:ImageButton ID="ImageButton2" runat="server" 
                                ImageUrl="~/Images/calendar.jpg" />
                        </td>
                        <td class="style20">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style43">
                            &nbsp;</td>
                        <td class="style39">
                            <asp:Label ID="Label3" runat="server" ForeColor="Red" 
                                Text="*Faltan Campos por llenar" Visible="False"></asp:Label>
                        </td>
                        <td class="style20">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style43">
                            &nbsp;</td>
                        <td class="style39">
                            <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
                                Text="Guardar" CssClass=JCIstyle />
                            <ajaxToolkit:ConfirmButtonExtender ID="Button2_ConfirmButtonExtender" 
                                runat="server" ConfirmText="Esta segura de guardar esta tarea?" Enabled="True" TargetControlID="Button2">
                            </ajaxToolkit:ConfirmButtonExtender>
                        </td>
                        <td class="style20">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>

            </asp:Panel>
                </asp:View>
                <asp:View ID="View2" runat="server">
                    
                    <asp:Panel ID="Panel2" runat="server" GroupingText="Crear Tarea" 
                        style="text-align: left">
                        <table class="style1">
                            <tr>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                    Seleccione un Miembro.</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                    <asp:DataList ID="DataList1" runat="server" 
                                        onitemcommand="DataList1_ItemCommand">
                                        <HeaderTemplate>
                                        <tr>
                                        <td>
                                            <asp:Label ID="LabCI" runat="server">CI</asp:Label>
                                            </td>
                                            <td>
                                            <asp:Label ID="LabNombre" runat="server">Nombre</asp:Label>
                                            </td><td>
                                            <asp:Label ID="Apellido" runat="server">Apellido</asp:Label>
                                            </td><td>
                                            <asp:Label ID="Cargo" runat="server">Cargo</asp:Label>
                                            </td><td>
                                            <asp:Label ID="Miembro" runat="server">Miembro</asp:Label>
                                            </td><td>                                           
                                       </td>
                                       </tr>
                                </HeaderTemplate>
                                 <ItemTemplate>
                                <tr>
                                <td>
                                    <asp:Label ID="CI" runat="server" Text='<%#Eval("CI") %>'></asp:Label>
                                    </td><td>
                                    <asp:Label ID="nombre" runat="server" Text='<%#Eval("Nombre")%>'></asp:Label>
                                    </td><td>
                                    <asp:Label ID="Apellido" runat="server" Text='<%#Eval("ApellidoPaterno") %>'></asp:Label>
                                    </td><td>
                                    <asp:Label ID="Cargo" runat="server" Text='<% #Eval("Cargo")%>'></asp:Label>
                                    </td><td>
                                    <asp:LinkButton ID="MiembroButn" runat="server" CommandArgument='<%#Eval("CI") %>' OnClick="MiembroBtn_Click" >Seleccionar</asp:LinkButton>
                                    </td>
                                </tr>
                                </ItemTemplate>
                                    </asp:DataList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:Panel>
                    
                </asp:View>
                <asp:View ID="View3" runat="server">
                    <asp:Panel ID="Panel3" runat="server" GroupingText="Crear Tarea">

                        <table class="style1">
                            <tr>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style29">
                                    Selccione una tarea.</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style29">
                                    <asp:DataList ID="DataList2" runat="server" 
                                        onitemcommand="DataList2_ItemCommand">
                                    <HeaderTemplate>
                                        <tr>
                                        <td>
                                            <asp:Label ID="LabCodigo" runat="server">Codigo</asp:Label>
                                            </td>    
                                               <td>
                                            <asp:Label ID="LabNombre" runat="server">Nombre</asp:Label>
                                            </td><td>
                                            <asp:Label ID="fecini" runat="server">Fecha_Inicio</asp:Label>
                                            </td><td>
                                            <asp:Label ID="fecfin" runat="server">Fecha_Fin</asp:Label>
                                            </td><td>
                                            <asp:Label ID="Programa" runat="server">Programa</asp:Label>
                                            </td><td>                                           
                                       </td>
                                       </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                <tr>
                                <td>
                                    <asp:Label ID="Codigo" runat="server" Text='<%#Eval("CodigoPrograma") %>'></asp:Label>
                                    </td>       <td>
                                    <asp:Label ID="nombre" runat="server" Text='<%#Eval("Nombre")%>'></asp:Label>
                                    </td><td>
                                    <asp:Label ID="fecini" runat="server" Text='<%#Eval("FechaInicio") %>'></asp:Label>
                                    </td><td>
                                    <asp:Label ID="fecfin" runat="server" Text='<% #Eval("FechaFin")%>'></asp:Label>
                                    </td><td>
                                    <asp:LinkButton ID="ProgramaButn" runat="server" CommandArgument='<%#Eval("CodigoPrograma") %>' OnClick="ProgramaBtn_Click" >Seleccionar</asp:LinkButton>
                                    </td>
                                </tr>
                                </ItemTemplate>
                                    </asp:DataList>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>

                    </asp:Panel>
                </asp:View>
            </asp:MultiView>
           
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
